<template>
  <div id="app">
    <button @click="count++">count----{{count}}</button>
    <h1>你好，卡布达</h1>
    <list>
      <p>你好你好-slot</p>
    </list>
    <img alt="Vue logo" src="./assets/logo.png" />
    <HelloWorld msg="Welcome to Your Vue.js App" />
    <ul>
      <li v-for="item in list" :key="item._id">
        <a :href="item.link">{{item.title}}</a>
      </li>
    </ul>
  </div>
</template>

<script>
import HelloWorld from "./components/HelloWorld.vue";
import list from "./components/list.vue";
import axios from "axios";

export default {
  name: "App",
  components: {
    HelloWorld,
    list
  },
  data() {
    return {
      count: 1,
      list: []
    };
  },
  created() {
    console.log("组件创建完成");
    axios.get("http://localhost:3000/api/v1/m").then(res => {
      console.log(res);
      this.list = res.data.movies;
    });
  }
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
